package com.clms.marketings.controller;

import com.clms.common.R;
import com.clms.marketings.pojo.entity.TbCustomerIssues;
import com.clms.marketings.pojo.vo.CustomerIssuesVo;
import com.clms.marketings.service.TbCustomerIssuesService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @program: clms-third
 * @description: 客服问答的控制层
 * @author: 赵露露
 * @create: 2021-07-23 10:14
 **/
@RestController
@RequestMapping("marketing/customer")
public class TbCustomerIssuesController {
    @Autowired
    private TbCustomerIssuesService tbCustomerIssuesService;
    //查询所有客服回答
    @GetMapping("selectall")
    public R selectAll(){
        return tbCustomerIssuesService.selectAll();
    }
    //增加客服回答
    @PostMapping("insertcustomerissues")
    public R insertCustomerIssuess(@RequestBody TbCustomerIssues tbCustomerIssues){
        return tbCustomerIssuesService.insertCustomerIssues(tbCustomerIssues);
    }
    //修改客服回答
    @PutMapping("updatecustomerissues")
    public R updateCustomerIssuess(@RequestBody TbCustomerIssues tbCustomerIssues){
        return tbCustomerIssuesService.updateCustomerIssues(tbCustomerIssues);
    }
    //删除客服回答
    @DeleteMapping
    public R deleteCustomerIssues(@RequestParam Integer id){
        return tbCustomerIssuesService.deleteCustomerIssues(id);
    }
    //根据id查广告位置
    @GetMapping("selectbyid/{id}")
    public R selectById(@PathVariable Integer id){
        return tbCustomerIssuesService.selectById(id);
    }
    //分页查询
    @PostMapping("selectpage/{currentPage}/{pageSize}")
    public R selectPage(@PathVariable Integer currentPage,
                        @PathVariable Integer pageSize,
                        @RequestBody CustomerIssuesVo customerIssuesVo){
        return tbCustomerIssuesService.selectPage(currentPage,pageSize,customerIssuesVo);
    }



}
